Effects of extreme temperatures on public sentiment in 49 Chinese cities

The rising sentiment challenges of the metropolitan residents may be attributed to the extreme temperatures. However, nationwide real-time empirical studies that examine this claim are rare. In this research, we construct a daily extreme temperature index and sentiment metric using geotagged posts on one of China's largest social media sites, Weibo, to verify this hypothesis. We find that extreme temperatures causally decrease individuals' sentiment, and extremely low temperature may decrease more than extremely high temperature. Heterogeneity analyses reveal that individuals living in high levels of PM2.5, existing new COVID-19 diagnoses and low-disposable income cities on workdays are more vulnerable to the impact of extreme temperatures on sentiment. More importantly, the results also demonstrate that the adverse effects of extremely low temperatures on sentiment are more minor for people living in northern cities with breezes. Finally, we estimate that with a one-standard increase of extremely high (low) temperature, the sentiment decreases by approximately 0.161 (0.272) units. Employing social media to monitor public sentiment can assist policymakers in developing data-driven and evidence-based policies to alleviate the adverse impacts of extreme temperatures.


Data and method
This study investigated the impact of extreme temperatures on the residents' sentiment in 49 cities, employing daily data from Weibo, China's largest microblogging social media platform 32 .Studying China is quite beneficial due to its diverse climate conditions 29 .Furthermore, compared to other cities, these 49 selected cities, including Tier 1, New Tier 1, and Tier 2 cities (1A section in SI Appendix), have larger populations and higher volumes of Weibo, thus ensuring greater robustness and richness in our findings.The study examined 497,736 posts from 49 main cities in China, spanning 12 months in 2020.The posts from cities' topics were intended to capture the changes within the cities instead of other extraneous topics.Subsequently, in order to eradicate the disturbances generated by redundant advertising posts, we applied a filtering process to eliminate duplicate posts, resulting in a dataset consisting of 266,744 posts (Fig. 1).The posts were categorized according to both geographical area and date in order to gather all pertinent posts for each city on specific days throughout 2020.This study evaluated the sentiment of each post utilizing Tencent's NLP platform sentiment analysis interface, which features a machinetrained sentiment analysis algorithm 28 .In detail, the sentiment analysis interface can analyze, process, summarize, and reason about subjective text with emotional overtones, identifying the probability score that writer's emotional disposition is positive.The score indicated the sentiment value given in a Weibo post.According to existing research, the sentiment index for a city on a specific day was determined by using the median sentiment value for that city on that day 28 .Comparing the average sentiment to the middle sentiment value, the median sentiment can be more helpful in eliminating the influence of extreme sentiment values.The indicator is measured on a scale of 0 to 100, where 0 represents a profoundly negative feeling, and 100 represents a significantly positive emotion.Furthermore, the subsequent models include the sentiment index as the dependent variable.
This study devised a collection of indicators to measure extreme temperatures in each city.Typically, a historical percentile threshold temperature for a given duration of time is used as the standard to determine if extreme temperature events occur.Extreme high-temperature events, also known as warm days, are characterized by temperatures beyond a historical threshold temperature, such as the 99th or 95th percentile, over a specific duration of time 33 .Similarly, when the temperature falls below a historical threshold temperature, such as the 1st or 5th percentile, it can be observed as an extreme low-temperature event, also known as a cold night 34,35 .

Definition of extreme temperatures
The temperature data employed in this study are sourced from the National Oceanic and Atmospheric Administration (NOAA) of the National Environmental Information Centre (NCEI).The data for the highest and lowest temperatures has been grouped by cities.The highest temperature for a city on a given day was determined by calculating the average of the highest temperature data from all the weather stations in that city.Likewise, we acquired the cities' daily lowest temperature data using the identical approach.Then, we utilized the highest temperature subtract the standard of 95% of the city's highest temperature for the day from 2000 to 2019 to obtain the index, which shows the degree to which the daily highest temperature is above the daily extreme high-temperature standard ( 95%EHTit ).We then employed the difference between the standard of 5% of the city's minimum temperature for the day from 2000 to 2019 and the daily minimum temperature of the city, indicating the degree that the daily minimum temperature falls below the daily extreme low-temperature standard ( 5%ELTit ).Furthermore, combined with speed of wind, we calculated extremely high-apparent temperature ( EHATit ) and extremely low-apparent temperature ( ELATit ).Moreover, we extended the given duration of time to 30 years (1990-2019), and calculated another extreme temperatures index in the same way ( 90%TEHTit , 10%TELTit ).95%EHTit , 5%ELTit , EHATit and ELATit are defined by Eqs.(1-4) separately. (1)

Instrumental variables (IV)
Drawing on related studies 28 , we employed data from neighboring cities to simulate explanatory variables in target cities.Suppose cities bordering the target city are at the same altitude as the target city.In that case, the temperatures of these cities are comparable to the target city and can be used to synthesize the target city temperature.Additionally, as an ideal IV, temperatures in other cities are unlikely to impact the target city's local social and economic activities via other channels.Therefore, we performed synthetic simulations of the temperature of the target city using the temperature of other cities bordering the target city.The synthesized simulated extremely high temperatures and extremely low temperatures were defined as NEHTit and NELTit .According to the theorem that the temperature decreases by 0.6 °C for every 100 m of altitude increase, we recalculated the temperature of city j when the simulated city j were at the altitude level of the target city i, and then eliminated the effect on the temperature caused by the different altitudes of the city.
where EHT ijt represents the extremely high temperature of city j, bordering city i on day t, and ELT ijt also rep- resents the extremely low temperature of city j, bordering city i on day t.

Definition of extreme temperature differences
Similar to the definition of extreme temperatures, the difference between the maximum temperature difference and the 95% maximum temperature difference on the selected day and city was defined as EHTD it in formula (8).Moreover, the difference between the 5% minimum temperature and the minimum temperature difference on the selected day and city was defined as ELTD it in formula (9).

Results
MLR was utilized to determine the correlation between people's sentiment and extreme temperatures, including extremely high and low temperatures, in 49 cities in 2020.Moreover, we employed MLR to examine the impact of other extreme temperature variables on residents' sentiment, such as the extreme temperature difference between neighboring days and extremely apparent temperatures.

Impacts of extreme temperatures on sentiment
Each column in Table 1 reports the standardized coefficient and P-values based on model (5).This regression analysis was controlled for city and week fixed effects while also incorporating control variables (1B section in SI Appendix).This paper employed the overall sentiment index as the dependent variable, which is determined by computing the median sentiment value for a specific city on a given day.The dataset comprises 16,944 observations from 49 cities in 2020.Initially, we utilized 95%EHTit and 5%ELTit as explanatory variables (2nd column of Table 1).Subsequently, robustness checks were conducted using 90%EHTit and 10%ELTit as explanatory variables (3th of Table 1).Considering that wind speed may affect the human body's perceived temperature, we introduced wind speed to construct extremely apparent temperature indicators including 95%EHATit , 5%ELATit , 90%EHATit and 10%ELATit (4th and 5th column of Table 1).
According to the results of Table 1, a negative correlation exists between sentiment and extreme temperatures ( 95%EHTit,5%ELTit,90%EHTit , 10%ELTit ).Extreme temperatures significantly reduce the sentiment score of residents.The findings indicate that for a one-standard increase in the 5%ELTit , there is a corresponding decrease of 0.2724 units in the sentiment score; while a one-standard unit increase in the 95%EHTit corresponds to a (4) decrease of 0.1606 units in the sentiment score.Similarly, a one-standard increase in 90%EHTit is associated with a reduction of 0.1490 units in residents' sentiment score while a one-standard increase in 10%ELTit leads to a decrease of 0.2936 units in residents' sentiment.Our findings indicate that when loosening the criteria for defining extremely high and low temperatures, individuals may exhibit increased sensitivity towards extremely low temperature but decreased sensitivity towards extremely high temperature.

Robustness checks
The MLR analysis revealed the connections between sentiment and extreme temperatures.To strengthen the reliability of the findings, we employed the Baidu NLP tool to generate an additional sentiment score using the same procedures.This score was then incorporated into the regression model as an explanatory variable (5) to verify the conclusions further.Subsequently, a rigorous assessment was performed using temperature data from the Met Office.The negative correlations have been determined to remain valid (Table 2).
The negative link between extreme temperatures and citizens' sentiment may be attributed to omitting varying daily factors at the city level.The urban heat island effect, a result of urbanization closely associated with economic expansion, may impact individuals' sentiment.Given this scenario, our assessments would be inclined to ascribe negative sentiment exclusively to extremely high and low temperatures, resulting in a biased estimation.In order to tackle this possible problem of endogeneity, the researchers utilized the IV technique.Despite implementing this method, extreme temperatures still negatively impacted sentiment, as indicated in Table 3.
The results of the unidentifiable test and the weak IV test are shown in the third section SI Appendix.
To further validate the robustness of the extreme temperature indicator, the 90th and 10th historical percentile threshold temperature for 30 years were used to recalculate extremely high temperature ( 90%TEHTit ) and extremely low temperature ( 10%TELTit) 37 .The results were shown in Table 4.It was found that the adverse effects of extreme temperatures on sentiment were still significantly present.

Impacts of extreme temperature differences on sentiment
While the sentiment might be influenced by fluctuations in neighboring extreme temperatures, extreme temperature differences were introduced as explanatory variables to investigate further the relationship between residents' sentiment and extreme temperatures.EHTDit and ELTDit were replaced for regression.It was found that extremely high-temperature difference and extremely low-temperature difference from neighboring days played a negative role in the sentiment (Table 5).Moreover, residents appear more sensitive to ELTDit (− 0.2003) than EHTDit(− 0.1177).Similarly, we analyzed the effects of extremely high-apparent-temperature difference and low-apparent-temperature difference.It was revealed that extremely apparent-temperature differences also have a negative impact on sentiment (Table 5).It has been suggested that global warming's effect on human thermal comfort could increase heat stress and decrease cold stress 38 .

Interactive effect
The degree of impacts of extreme temperatures on sentiment might be modified by several factors including wind speed, per capita disposable income and so on.Furthermore, we incorporated multiple interaction variables into the baseline model to examine the relationships to analyze.The results are shown in Table 3.The study revealed that the influence coefficients of extreme temperatures on sentiment might be affected by wind speed and per capita disposable income.In addition, the model incorporated the fixed effects of the 24 solar terms instead of the fixed effects of week.The adverse impacts of extreme temperatures on sentiment persisted.

Heterogeneity analysis
Moreover, the residents' sentiment is also influenced by other meteorological factors, holidays, weekdays, and significant public events.To comprehensively reveal the disparities in the impact of extreme temperatures on sentiment under various conditions, heterogeneity analysis was employed for investigation in this paper.PM2.5 can detrimentally affect residents' health, leading to a decrease in their sentiment.As per the 2021 World Health Organization (WHO) Global Air Quality Guidance (AQG) published in 2021, which set a target daily average PM2.5 level at 15 μg/m 339 , we divided the dataset into two groups based on the threshold value of PM2.5 (Fig. 3A).
The results indicated that when PM2.5 levels exceeded 15 μg/m 3 , individuals exhibited greater sensitivity to both extremely high temperature (-0.192) and extremely low temperature (-0.341) compared to when PM2.5 levels were below 15 μg/m 3 , where the sensitivity to extremely high temperature was -0.162 and extremely low temperature was − 0.308.It was revealed that extreme temperatures have a more detrimental impact on sentiment when air quality worsens.The variation in wind speed may lead the disparity between the ambient temperature and the subjective temperature experienced by individuals.Based on the Beaufort Wind Rating Table (BWRT), wind speeds equal to or less than 3.3 m/s are categorized as wind power level 2 and below, while wind speeds above 3.3 m/s fall under wind power level 3 and above.According to the definition of wind speed, we categorized the dataset into two groups for regression analysis using a threshold of 3.3 m/s.The control group consisted of observations with wind speeds below 3.3 m/s.The experimental group included observations with wind speeds equal to or greater than this threshold (Fig. 3B).Our findings indicated that the experimental group has a larger extreme high-temperature coefficient (− 0.150) compared to the control group (− 0.213).However, the control group has a larger extreme low-temperature coefficient (− 0.276) than the experimental group (− 0.371).Research findings indicated that the effect of extremely high temperature on residents' sentiment was less pronounced in a wind level 3 and above than in a wind level 2 and below.Nevertheless, the impact of extremely low temperatures was contrary.
On weekdays, residents have limited autonomy in their outdoor activities, whereas on weekends, they could decide whether go outside or not depending on the temperature.It was revealed that residents' sentiment was more sensitive to extreme temperatures on weekdays compared to weekends (Fig. 3C).Besides, public emergencies could exacerbate the impact of extreme temperatures on residents' sentiment.For instance, unexpected major public events such as epidemics 36,[40][41][42] , stock market fluctuations 43 , and hosting of the Olympic Games 44 can affect residents' sentiment.On days when there are adverse news events, the impact of extreme temperatures on residents' sentiment is further magnified.This study chose new confirmed cases of COVID-19 diagnoses as unexpected major public events.In cities where new cases of COVID-19 were reported, the coefficient of extremely high temperature (− 0.363) was lower compared to cities without new cases (− 0.143) (Fig. 3D).The results of the coefficient of extremely low temperature were the same.Furthermore, when there were new confirmed cases of COVID-19, the average sentiment score (44) was lower than it (46) when there was no new confirmed case of COVID-19.
The latitude and income conditions of cities may also exert influences.We divided our sample cities into two sections based on the Qinling and Huai River line to verify this hypothesis 45 .Our findings indicated that individuals residing in cities with lower latitudes (− 0.1143) were less sensitive to extremely high temperatures compared to those living in cities with higher latitudes (− 0.3345), while residents in areas with higher latitudes (− 0.3389) were less sensitive to extremely low temperatures than those residing in areas with lower latitudes (− 0.3965) (Fig. 4A).Furthermore, we employed the median per capita disposable income of 49 cities as a criterion and categorized them into two groups.Residents in economically disadvantaged cities were significantly more vulnerable to extremely high temperature (− 0.2546) and low temperature (− 0.4616) compared to residents in affluent cities (− 0.1588, − 0.349) (Fig. 4B).Individuals living in wealthier regions in China may have greater access like using air conditioning 46 , to coping mechanisms for dealing with extremely high temperature than those residing in poorer cities do.

Discussion
This research utilized a near-real-time, multi-step methodology that integrates statistical regression and NLP machine learning techniques to examine the influence of extreme temperatures on residents' sentiment.These approaches assisted us in identifying and measuring the impact of extreme temperatures on the sentiment.In addition, we identified differences in these impacts based on other factors, including the quantity of PM2.5, wind speed, and the presence of COVID-19.The findings provided policymakers with valuable insights into the impact of extreme temperatures on the citizens' sentiment, therefore aiding the formulation of policies to improve public sentiment.Nevertheless, it is crucial to consider this study's limitations when interpreting these findings.Firstly, the variables in the model were chosen based on an examination of existing research.However, there might be more elements that impact sentiment but were not taken into account.In order to tackle this issue, we incorporated several control variables into the model.By implementing the IV method, we effectively addressed the possible problem of endogeneity that could arise from omitted factors that can influence both extreme temperatures and the sentiment of inhabitants.
Furthermore, it is essential to acknowledge that the sentiment noticed on Weibo may not entirely and precisely reflect the sentiment of all inhabitants.In order to address this constraint, we selected geotagged posts that were published in the Weibo topics of 49 cities.Subsequent iterations of this study would consider incorporating data from additional urban areas in China and multiple social media platforms.

Conclusion
This research conducted an analysis of 266,744 posts from the 49 cities' topic section of Weibo in China, encompassing 12 months in 2020.Employing multiple regression analysis, this research revealed the substantial correlation between extreme temperatures and residents' sentiment.Subsequently, we utilized variables derived from several sources to substitute the dependent and independent variables in the baseline model to conduct robustness checks.These checks confirmed the adverse influence of extreme temperatures on sentiment.In addition, it was discovered that extremely apparent temperatures and extreme temperature differences negatively affected sentiment.Additionally, this paper discovered that other environmental factors, such as PM2.5 levels and wind, as well as city-specific circumstances like new COVID-19 cases, latitude, and per capita disposable income, may affect the coefficients of extreme temperatures.The variations in the effects of extreme temperatures on sentiment in different settings could provide valuable insights for policymakers.
Moreover, this research offers policymakers a tool to examine the immediate effects of extreme temperatures on residents' sentiment.It could assist them in comprehending the variations in impact across different environmental and urban settings.This study proposes a data-driven and evidence-based approach to implementing policies to improve residents' sentiment.Existing research indicates that negative sentiment may be linked to residents' health and the incidence of crimes 47,48 .Local governments can alleviate extreme temperatures' impact on individuals' sentiment by implementing financial incentives as coping mechanisms when temperatures surpass critical limits.During workdays, when air quality is poor or there are significant adverse public events, the government should employ public resources to reduce the adverse effects of extreme temperatures on residents' sentiment.This can be achieved by implementing measures such as issuing extreme temperature warnings, distributing appropriate medications, and installing extra cooling or heating equipment.These measures will, in turn, help mitigate negative sentiment's adverse impact on public health and criminal activities.The strategies to manage extreme temperatures should be tailored to each city based on its geographical location.Municipal governments in southern China should prioritize the impact of extremely low temperature and proactively implement measures such as issuing early warnings and distributing insulation materials.
Significant strengths lie in our methodology which enables real-time monitoring of changes in residents' sentiment with respect to extreme temperatures by combining various techniques such as MLR, IV approach and NLP technique.Based on this finding, government bodies should consider introducing corresponding policies and appropriate interventions to counteract the negative effects of extreme temperatures and mitigate their impact on residents' sentiment.

Figure 1 .
Figure 1.The distribution of 266,744 Weibo posts.Posts used in this paper are concentrated in three regions: the Beijing-Tianjin-Hebei urban agglomeration, the Yangtze River Delta urban agglomeration, and the Pearl River Delta urban agglomeration.Completely covering the largest urban agglomerations in China's north and south, it provides rich data for heterogeneity analysis.Image was drawn using ArcGIS Pro 3.0.2software by authors.

Figure 2 .
Figure 2. (A) The distribution of the CNI across China in 2020.This study utilized the cold night index of 340 cities in China to obtain the distribution of CNI across China in 2020.(B) The distribution of the WDI across China in 2020.This study utilized the WDI of 340 cities in China to obtain the distribution of warm day across China in 2020.Images were drawn using ArcGIS Pro 3.0.2software by authors.

Figure 3 .
Figure 3.The coefficients of extreme temperatures under different conditions.(A) PM2.5 level.(B) Wind speed level.(C) Weekdays or Weekends.(D) New COVID-19 diagnose.Images were drawn using Origin 2018 software by authors.

Table 1 .
The regression results of extreme temperature and extremely apparent temperature.The robust standard error is clustered by city.Standard Errors are shown in parentheses, *P < 0.1; **P < 0.05; ***P < 0.01.